<?php
//
//  VictoryCMS - Content managment system and framework.
//  Copyright (C) 2009  Lewis Gunsch
//
//  This file is part of VictoryCMS.
//
//  VictoryCMS is free software: you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation, either version 3 of the License, or
//  (at your option) any later version.
//
//  VictoryCMS is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with VictoryCMS.  If not, see <http://www.gnu.org/licenses/>.

/**
 * VictoryCMS - HalTest
 * 
 * @license http://www.gnu.org/licenses/gpl.html
 * @author Kyle Wenchowski
 * @filesource
 * @package DisplayablePages
 */

/**
 * Tests the HTML abstraction layer.
 * 
 * @package DisplayablePages
 */
class HalTest implements DisplayablePage {

	/**
	 * @see trunk/include/DisplayablePage#getTitle()
	 */
	public function getTitle() {
		return "HalTest";
	}

	/**
	 * @see trunk/include/DisplayablePage#getName()
	 */
	public function getName() {
		return "HalTest";
	}

	/**
	 * @see trunk/include/DisplayablePage#getDescription()
	 */
	public function getDescription() {
		return "class HalTest implements DisplayablePage {";
	}

	/**
	 * @see trunk/include/DisplayablePage#getKeywords()
	 */
	public function getKeywords() {
		return "";
	}

	/**
	 * @see trunk/include/DisplayablePage#getHeaderInfo()
	 */
	public function getHeaderInfo() {
		return "";
	}

	/**
	 * @see trunk/include/DisplayablePage#renderPage()
	 */
	public function renderPage( $currentPage ) {
		// Call all functions from Form.php and Table.php
		 
		$html = "";
		 
		$htmlList = new HtmlList();
		$form = new Form($htmlList);
		 
		$form->beginForm("", array("method"=>"post", "title"=>"titletest", "style"=>"color:green"));
		$form->beginFieldSet(array());
		$form->pushLegend("test", array());
		 
		$table = new Table($htmlList);
		 
		$table->beginTable(array());
		$table->beginRow(array());
		$table->pushTableHeadCell("Name", array());
		$table->pushCell("test", array());
		$table->pushTableHeadCell("Date", array());
		$table->pushTableHeadCell("Size", array());
		$table->pushTableHeadCell("&nbsp;", array());
		$table->pushTableHeadCell("&nbsp;", array());
		$table->endRow();
		$table->endTable();

		$form->pushBreak();
		$form->beginSelect(array("size"=>"15"));
		$form->pushOption("Test Option", array("label"=>"pushoptionlabeltest", "value"=>"Option text"));
		$form->endSelect();
		$form->pushBreak();	
		$form->pushSubmitInput(array("type"=>"submit"));
		$form->pushBreak();
		$form->pushFileInput(array("type"=>"file", "size"=>"10"));
		$form->pushBreak();
		$form->pushTextInput(array("type"=>"text", "maxlength"=>"8", "size"=>"10"));
		$form->pushBreak();
		$form->pushHidden(array("type"=>"hidden"));
		$form->pushBreak();
		$form->pushLabel("pushlabeltest", array());


		$form->endFieldSet();
		$form->endForm();

		$html .= $htmlList->render();
		 
		return $html;
	}

	/**
	 * @see trunk/include/DisplayablePage#pagePreProcess()
	 */
	public function pagePreProcess() {
		return;
	}

	/**
	 * @see trunk/include/DisplayablePage#getPagePermissionLevel()
	 */
	public function getPagePermissionLevel() {
		return new Permission("anonymous");
	}

}

?>